package com.definity.toolkit.email;

import java.util.ArrayList;
import java.util.List;

public class Email {

	private String subject;
	private String content;
	private String from;
	private String contentType;
	private final List<String> to = new ArrayList<String>();
	private final List<Attachment> attachments = new ArrayList<Attachment>();

	public Email() {		
		setContentType("text/html");
	}
	
	public void addAttachment(Attachment attachment) {
		attachments.add(attachment);
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void attach(Attachment attachment) {
		attachments.add(attachment);
	}

	public void removeAttachment(Attachment attachment) {
		attachments.remove(attachment);
	}
	
	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public List<String> getTo() {
		return to;
	}

	public void addTo(String email){
		to.add(email);
	}

	public void removeTo(String email){
		to.remove(email);
	}

	public String getContentType() {
		return contentType;
	}
	
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	
}
